<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
  <title>Description of rbfderiv</title>
  <meta name="keywords" content="rbfderiv">
  <meta name="description" content="RBFDERIV Evaluate derivatives of RBF network outputs with respect to weights.">
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <meta name="generator" content="m2html &copy; 2003 Guillaume Flandin">
  <meta name="robots" content="index, follow">
  <link type="text/css" rel="stylesheet" href="../../m2html.css">
</head>
<body>
<a name="_top"></a>
<div><a href="../../menu.html">Home</a> &gt;  <a href="#">ReBEL-0.2.7</a> &gt; <a href="#">netlab</a> &gt; rbfderiv.m</div>

<!--<table width="100%"><tr><td align="left"><a href="../../menu.html"><img alt="<" border="0" src="../../left.png">&nbsp;Master index</a></td>
<td align="right"><a href="menu.html">Index for .\ReBEL-0.2.7\netlab&nbsp;<img alt=">" border="0" src="../../right.png"></a></td></tr></table>-->

<h1>rbfderiv
</h1>

<h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
<div class="box"><strong>RBFDERIV Evaluate derivatives of RBF network outputs with respect to weights.</strong></div>

<h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
<div class="box"><strong>function g = rbfderiv(net, x) </strong></div>

<h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
<div class="fragment"><pre class="comment">RBFDERIV Evaluate derivatives of RBF network outputs with respect to weights.

    Description
    G = RBFDERIV(NET, X) takes a network data structure NET and a matrix
    of input vectors X and returns a three-index matrix G whose I, J, K
    element contains the derivative of network output K with respect to
    weight or bias parameter J for input pattern I. The ordering of the
    weight and bias parameters is defined by RBFUNPAK.  This function
    also takes into account any mask in the network data structure.

    See also
    <a href="rbf.html" class="code" title="function net = rbf(nin, nhidden, nout, rbfunc, outfunc, prior, beta)">RBF</a>, <a href="rbfpak.html" class="code" title="function w = rbfpak(net)">RBFPAK</a>, <a href="rbfgrad.html" class="code" title="function [g, gdata, gprior] = rbfgrad(net, x, t)">RBFGRAD</a>, <a href="rbfbkp.html" class="code" title="function g = rbfbkp(net, x, z, n2, deltas)">RBFBKP</a></pre></div>

<!-- crossreference -->
<h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
This function calls:
<ul style="list-style-image:url(../../matlabicon.gif)">
<li><a href="consist.html" class="code" title="function errstring = consist(model, type, inputs, outputs)">consist</a>	CONSIST Check that arguments are consistent.</li><li><a href="rbfbkp.html" class="code" title="function g = rbfbkp(net, x, z, n2, deltas)">rbfbkp</a>	RBFBKP	Backpropagate gradient of error function for RBF network.</li><li><a href="rbffwd.html" class="code" title="function [a, z, n2] = rbffwd(net, x)">rbffwd</a>	RBFFWD	Forward propagation through RBF network with linear outputs.</li></ul>
This function is called by:
<ul style="list-style-image:url(../../matlabicon.gif)">
</ul>
<!-- crossreference -->


<h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
<div class="fragment"><pre>0001 <a name="_sub0" href="#_subfunctions" class="code">function g = rbfderiv(net, x)</a>
0002 <span class="comment">%RBFDERIV Evaluate derivatives of RBF network outputs with respect to weights.</span>
0003 <span class="comment">%</span>
0004 <span class="comment">%    Description</span>
0005 <span class="comment">%    G = RBFDERIV(NET, X) takes a network data structure NET and a matrix</span>
0006 <span class="comment">%    of input vectors X and returns a three-index matrix G whose I, J, K</span>
0007 <span class="comment">%    element contains the derivative of network output K with respect to</span>
0008 <span class="comment">%    weight or bias parameter J for input pattern I. The ordering of the</span>
0009 <span class="comment">%    weight and bias parameters is defined by RBFUNPAK.  This function</span>
0010 <span class="comment">%    also takes into account any mask in the network data structure.</span>
0011 <span class="comment">%</span>
0012 <span class="comment">%    See also</span>
0013 <span class="comment">%    RBF, RBFPAK, RBFGRAD, RBFBKP</span>
0014 <span class="comment">%</span>
0015 
0016 <span class="comment">%    Copyright (c) Ian T Nabney (1996-2001)</span>
0017 
0018 <span class="comment">% Check arguments for consistency</span>
0019 errstring = <a href="consist.html" class="code" title="function errstring = consist(model, type, inputs, outputs)">consist</a>(net, <span class="string">'rbf'</span>, x);
0020 <span class="keyword">if</span> ~isempty(errstring);
0021   error(errstring);
0022 <span class="keyword">end</span>
0023 
0024 <span class="keyword">if</span> ~strcmp(net.outfn, <span class="string">'linear'</span>)
0025   error(<span class="string">'Function only implemented for linear outputs'</span>)
0026 <span class="keyword">end</span>
0027 
0028 [y, z, n2] = <a href="rbffwd.html" class="code" title="function [a, z, n2] = rbffwd(net, x)">rbffwd</a>(net, x);
0029 ndata = size(x, 1);
0030 
0031 <span class="keyword">if</span> isfield(net, <span class="string">'mask'</span>)
0032     nwts = size(find(net.mask), 1);
0033     temp = zeros(1, net.nwts);
0034 <span class="keyword">else</span>
0035     nwts = net.nwts;
0036 <span class="keyword">end</span>
0037 
0038 g = zeros(ndata, nwts, net.nout);
0039 <span class="keyword">for</span> k = 1 : net.nout
0040   delta = zeros(1, net.nout);
0041   delta(1, k) = 1;
0042   <span class="keyword">for</span> n = 1 : ndata
0043       <span class="keyword">if</span> isfield(net, <span class="string">'mask'</span>)
0044       temp = <a href="rbfbkp.html" class="code" title="function g = rbfbkp(net, x, z, n2, deltas)">rbfbkp</a>(net, x(n, :), z(n, :), n2(n, :), delta);
0045       g(n, :, k) = temp(logical(net.mask));
0046       <span class="keyword">else</span>
0047       g(n, :, k) = <a href="rbfbkp.html" class="code" title="function g = rbfbkp(net, x, z, n2, deltas)">rbfbkp</a>(net, x(n, :), z(n, :), n2(n, :),<span class="keyword">...</span>
0048           delta);
0049       <span class="keyword">end</span>
0050   <span class="keyword">end</span>
0051 <span class="keyword">end</span>
0052 
0053</pre></div>
<hr><address>Generated on Tue 26-Sep-2006 10:36:21 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/">m2html</a></strong> &copy; 2003</address>
</body>
</html>